<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <link rel="stylesheet" media="screen" type="text/css" href="./style.css" />
  <link rel="stylesheet" media="screen" type="text/css" href="./design.css" />
  <link rel="stylesheet" media="print" type="text/css" href="./print.css" />

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div class="dokuwiki export">

<h1 class="sectionedit1"><a name="gsch2pcb_gschem_to_pcb_readme" id="gsch2pcb_gschem_to_pcb_readme">gsch2pcb (gschem to PCB) README</a></h1>
<div class="level1">
<pre class="code">gsch2pcb
--------
gsch2pcb is a program that interfaces a set of schematics generated with
with the gEDA gschem to PCB layout files.

gsch2pcb is conceptually similar to the gschem2pcb shell script, but
additionally handles multiple schematics, handles file element footprints,
and removes pc board elements corresponding to components deleted from the
schematics.  It also forward annotates component value changes.

Using gsch2pcb allows you to drive all design changes from the gschem
schematics without the headache of manually keeping PCB elements and
element values in sync.

It requires that the gnet-gsch2pcb.scm file be install into the gEDA
scheme directory.  On Debian this is /usr/share/gEDA/scheme, but see
the INSTALL file.

Typical usage
-------------
1) Create your custom PCB elements and save each one into its own file.
   Some compatibility tips if you will be inserting elements into a
   layout manually as well as with gsch2pcb:
     *  Make the initial &quot;Description&quot; field of these elements the same
        as the file name because gsch2pcb depends on this name (which is
        the gschem footprint
        value) to know when footprints/elements are changed.
     *  Make the initial layout-name field (displayed when the &quot;name on PCB&quot;
        menu entry is selected) empty (ie &quot;&quot;) so that gsch2pcb
        will not delete your element when you want it to be in the layout
        even though it is not in the schematic.  You can later edit the
        layout-name to be some refdes value, but I&#039;m not sure it makes sense
        to name a PCB element that is not referenced in the schematic.

   Note: since once a layout element is named PCB won&#039;t let you reset it
   to an empty name, a sort of kludge is that setting the first character
   of the layout-name to a non-alphanumeric will protect the element from
   being deleted by gsch2pcb.

   These file elements should be placed in a directory hierarchy that
   gsch2pcb will search.  The default directories /usr/local/pcb_lib and
   ./packages are searched in addition to any directories you specify with
   --elements-dir dirname arguments to gsch2pcb.

2) Create your schematic with gschem.  Make sure each component has a
   unique refdes attribute and a footprint attribute that matches either
   a PCB m4 element or one of your custom file element names.  Beware of
   file element names that collide with PCB m4 macro names (or specify the
   use-files option).
   Make a project file if you wish.

3) Run &quot;gsch2pcb foo.sch&quot; or &quot;gsch2pcb myproject&quot; if you&#039;ve created the
   myproject file.  If you didn&#039;t specify an output name, this will generate
   a foo.pcb and a foo.net file.
   If you get errors about footprints not found, you need to create PCB
   elements for them and repeat this step until you get no errors.
   Or, just run gsch2pcb again and it will shift unfound elements to
   foo.new.pcb and you can proceed using PCB on foo.pcb if you wish to
   fix the errors from inside of PCB.

4) Run &quot;pcb foo.pcb&quot;.  All the elements will be stacked on top of each other,
   so move them to desired locations.  Load the netlist file foo.net and
   proceed with using PCB.

5) Modify foo.sch and again run &quot;gsch2pcb foo.sch&quot;.
   * If components were added, PCB elements for them will be placed in the
     file foo.new.pcb.  If components were deleted, the elements for them
     will be removed from foo.pcb and the original foo.pcb will be renamed
     to a foo.pcb.bak sequence.
   * If elements can&#039;t be found for new schematic footprints, then the
     unfound elements will be indicated with PKG_ lines in foo.new.pcb
     unless you run &quot;gsch2pcb --remove-unfound foo.sch&quot; which will omit
     the PKG_ lines so you can go ahead and load foo.new.pcb into PCB.
   * Note that If you have added elements to the .pcb layout which
     will not exist on the schematics (mounting holes, etc), make sure
      there is no &quot;name on PCB&quot; (the gschem refdes) for them or else gsch2pcb
     will delete them when they don&#039;t match a schematic refdes and footprint.
     You could use the --preserve option to prevent deleting any elements at
     all, but this is really not the best way to use gsch2pcb.

6) Run &quot;pcb foo.pcb&quot; and clean up any dangling traces left over from removed
   elements.  Load any new elements in foo.new.pcb with the &quot;Load layout
   data to paste-buffer&quot; function.  Load the new netlist foo.net.


Caveats
-------
* gsch2pcb uses a gnetlist backend gnet-gsch2pcb.scm, so be sure when you
  install gsch2pcb that the gnet-gsch2pcb.scm file gets installed into the
  right place.  Look at the INSTALL file in the tarball.

* WARNING:  if you wish to start processing with gsch2pcb any existing PCB
  files that have m4 elements and were originally generated with gschem2pcb,
  then be sure to run first with at least gsch2pcb 0.4:

     gsch2pcb --fix-elements

  on the PCB file schematics or else gsch2pcb will want to delete the
  m4 elements.

* footprint information is saved into PCB element&#039;s Description fields,
  so it&#039;s probably not a good idea to change element Description values
  in your layout while using gsch2pcb unless it is a protected element
  that has an empty layout-name.



Bill Wilson    billw@wt.net</pre>

</div>
</div>
</body>
</html>
